package com.example.demo.design;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;

import java.util.HashMap;
import java.util.Map;

/**
 * 蔡定努
 * 2025/05/30 10:20
 */
public class DynamicProperties {
    private String staticField;
    private Map<String, Object> dynamicProperties = new HashMap<>();

    public String getStaticField() {
        return staticField;
    }

    public void setStaticField(String staticField) {
        this.staticField = staticField;
    }

    @JsonAnyGetter
    public Map<String, Object> getDynamicProperties() {
        return dynamicProperties;
    }

    @JsonAnySetter
    public void setDynamicProperty(String name, Object value) {
        dynamicProperties.put(name, value);
    }
}
